There are two ways that you can access run ends data:
-
IG_image_DIB_raster_pntr_get() is a general purpose function for getting a pointer to pixel data for a given raster. If you use it on a 1bpp image, it will return a pointer to a run ends raster. You can access this raster directly, but be aware of the following:
- There is an additional AT_RUN value at the beginning of the raster. This value is equal to the total number of AT_RUN values used to store the raster, including this value. For example, for the raster "11001000", this value would be 7.
- You cannot write data that exceeds the original length of a raster, because ImageGear allocates only enough space to hold the runs for that raster. For this reason, it is safer to use IG_runs_row_set(), which can reallocate if necessary.
- Run ends rasters are not stored contiguously in memory. You must call IG_image_DIB_raster_pntr_get() for each raster you want to process.